package org.windowkit.toolkit.print;

import javax.swing.JComponent;

/**
 * SPrinterListener simplifies the PrintListener interface, allowing the
 * printing component to be notified only when it needs to set itself back to
 * its preprinting state.
 *
 * @author Eric Lundin
 */
public interface PrintableComponent {
	public static final String PRINT_COMMAND = "Print Table";

	public static final String PRINT_PREVIEW_COMMAND = "Print Preview";

	/**
	 * Called when a component should prepare itself for printing. For example a
	 * table would most likely remove its row selections before printing and
	 * then readd them when the job is done to prevent any selections from being
	 * printed.
	 */
	public void prepareForPrint();

	/**
	 * Called when the print job is completely finished and the component should
	 * restore itself to its preprintig state. For example a table would most
	 * likely remove its row selections before printing and then readd them when
	 * the job is done to prevent any selections from being printed.
	 */
	public void restorePrePrintState();

	/**
	 * Returns the component to be printed.
	 */
	public JComponent getPrintComponent();

	/**
	 * Returns the header to be printed.
	 *
	 * @return
	 */
	public JComponent getPrintHeader();

}
